package com.tring.ysyn.util;

import cn.dev33.satoken.stp.StpUtil;
import com.tring.ysyn.entity.SysUser;

/**
 * 用户工具类
 * @author Tring
 * date 2022-10-31
 */
public class UserUtils {

    /**
     * 获取当前用户
     * @return
     */
    public static SysUser getCurrentUser(){
        try {
            SysUser user = (SysUser) StpUtil.getSession().get("user");
            return user;
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }
}
